<?php
header("content-type:text/html;charset=utf-8");
include("conn/conn.php");
$name=$_POST["name"];
$pass=$_POST["password"];
$nub=$_POST["number"];
if($name=="昵称" || $pass=="密码（请输入尽量难的密码）"){
	echo("<script>alert('用户名或密码为空');window.location.href='register.php';</script>");
	}
$sql_pd="select * from tb_account where name='".$name."'";
$result_pd=mysqli_query($link,$sql_pd);
if(mysqli_num_rows($result_pd)>0){
	echo"此用户已存在，请重新输入";
}
	else{
		$sql="insert into tb_account(name,password,number)values('".$name."','".$pass."','".$nub."')";
		mysqli_query($link,$sql);
		echo("<script>alert('注册成功，请登录');window.location.href='login.php';</script>");
	}
?>
